CONTENTS | INDEX | PREV | NEXT
assert
NAME
assert - assert that an expression is true, else abort
SYNOPSIS
#include <assert.h>
assert(condition); /* MACRO */
FUNCTION
assert checks the condition and if NOT true prints an error
message indicating the source filename and line number that the
assert failed at, and then abort()s.
The DICE version of assert generates a single static string in
assert.h for each module containing the file name. Multiple usages
of assert() refer to the same physical filename string.
EXAMPLE
#include <assert.h>
main(ac, av)
int ac;
char **av;
{
assert(ac > 1); /* expect at least one argument! */
return(0);
}
INPUTS
expression - an expression which the macro converts into
an if(!(expression)).
RESULTS
none